export default store => {

  // console.log('store初始化了');
  if (localStorage.state) store.replaceState(JSON.parse(localStorage.state))
  store.subscribe((mutation,state) => {
    // console.log('提交mutation');
    //把state 转换成 字符串
    localStorage.state = JSON.stringify(state)
  })
}